﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CRM.Database.Model.TechnicRequestsExt>" %>
<%--<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CRM.Models.TechnicRequestsExt>" %>--%>
<%@ Import Namespace="CRM.Controllers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Новая заявка на выезд
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Новая заявка на выезд</h2>


<% using (Html.BeginForm("TechnicRequestCreate", "TD", FormMethod.Post, new { @class = "edit_form" }))
       { %>
    <%: Html.ValidationSummary(true) %>
    <%:Html.Hidden("Key")%>
    <%:Html.Hidden("Request.IdCustomer")%>


    <table>
        <tr>
            <td>
                <%:Html.DevExpress().Label(
              settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Сроки выезда:";
                      settings.Width = 120;
                  }).GetHtml() %>
            </td>
        </tr>
        <tr>
            <td>
            <%:Html.DevExpress().Label(
              settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "C:";
                      settings.Width = 120;
                  }).GetHtml() %>
            </td>
            <td>
            <%:Html.DevExpress().DateEdit(settings =>
                {
                    settings.Name = "Request.BeginDate";
                    settings.Properties.DisplayFormatString = "D";
                    settings.Width = 120;
                }).Bind(Model.Request.BeginDate).GetHtml() %>
            </td>
            <td>
            <%:Html.DevExpress().Label(
              settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "По:";
                      settings.Width = 120;
                  }).GetHtml() %>
            </td>
            <td>
            <%:Html.DevExpress().DateEdit(settings =>
                {
                    settings.Name = "Request.EndDate";
                    settings.Properties.DisplayFormatString = "D";
                    settings.Width = 120;
                }).Bind(Model.Request.EndDate).GetHtml() %>
            </td>
        </tr>
    </table>

    <br />
    
    
    
    <%:Html.DevExpress().Label(settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Название юр. лица";
                      settings.Width = 232;
                  }).GetHtml() %>
    <%: Html.Partial("TechnicRequestLEPartial", Model)%>

    <br />

    <%:Html.DevExpress().Label(settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Контакты";
                      settings.Width = 232;
                  }).GetHtml() %>
    <%: Html.Partial("TechnicRequestContactPartial", Model)%>

    <br />
    
    <%:Html.DevExpress().Label(settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Адреса:";
                      settings.Width = 232;
                  }).GetHtml() %>
    <%: Html.Partial("TechnicRequestAddressesPartial", Model)%>

    
    <br />
    
    <%:Html.DevExpress().Label(settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Тип выезда:";
                      settings.Width = 232;
                  }).GetHtml() %>
    <%: Html.Partial("TechnicRequestVisitsTypes", Model)%>

    <br />
    
    <%:Html.DevExpress().Label(settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Система:";
                      settings.Width = 232;
                  }).GetHtml() %>
    <%:Html.Action("TechnicRequestProductSystems", Model)%>
    
    <br />

    <%:Html.DevExpress().Label(
              settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Комментарий";
                      settings.Width = 500;
                  }).GetHtml() %>
    <%:Html.DevExpress().Memo( settings => 
                    {
                        settings.Name = "Request.Comments";
                        settings.Width = 500;
                        settings.Height = 20;
                        settings.Properties.NullText = "Комментарии...";
                    }).GetHtml()%>
    
    <br />
    
    <%:Html.DevExpress().Label(settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Прикрепляемые файлы:";
                      settings.Width = 232;
                  }).GetHtml() %>
    <%:Html.DevExpress().UploadControl(settings =>
       {
            settings.Name = "ucMultiFile";
            settings.AddUploadButtonsHorizontalPosition = AddUploadButtonsHorizontalPosition.Left;
            settings.FileInputCount = UploadControlDemosHelper.FileInputCount;
            settings.ShowAddRemoveButtons = true;
            settings.Width = 500;
           settings.FileInputCount = 1;
            //settings.ValidationSettings.Assign(UploadControlDemosHelper.ValidationSettings);
       }).GetHtml()%>

    <br />

    <button type="submit" value="Создать заявку">Создать заявку</button>
    <% } %>

</asp:Content>
